Optimal. Leaf size=278 \[ \frac{\left (15 a^2 b B+5 a^3 C+12 a b^2 C+4 b^3 B\right ) \tan ^3(c+d x)}{15 d}+\frac{\left (15 a^2 b B+5 a^3 C+12 a b^2 C+4 b^3 B\right ) \tan (c+d x)}{5 d}+\frac{\left (18 a^2 b C+8 a^3 B+18 a b^2 B+5 b^3 C\right ) \tanh ^{-1}(\sin (c+d x))}{16 d}+\frac{b \left (14 a^2 C+18 a b B+5 b^2 C\right ) \tan (c+d x) \sec ^3(c+d x)}{24 d}+\frac{\left (18 a^2 b C+8 a^3 B+18 a b^2 B+5 b^3 C\right ) \tan (c+d x) \sec (c+d x)}{16 d}+\frac{b^2 (4 a C+3 b B) \tan (c+d x) \sec ^4(c+d x)}{15 d}+\frac{b C \tan (c+d x) \sec ^3(c+d x) (a+b \sec (c+d x))^2}{6 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.608875, antiderivative size = 278, normalized size of antiderivative = 1., number of steps used = 9, number of rules used = 8, integrand size = 40, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.2, Rules used = {4072, 4026, 4076, 4047, 3767, 4046, 3768, 3770} \[ \frac{\left (15 a^2 b B+5 a^3 C+12 a b^2 C+4 b^3 B\right ) \tan ^3(c+d x)}{15 d}+\frac{\left (15 a^2 b B+5 a^3 C+12 a b^2 C+4 b^3 B\right ) \tan (c+d x)}{5 d}+\frac{\left (18 a^2 b C+8 a^3 B+18 a b^2 B+5 b^3 C\right ) \tanh ^{-1}(\sin (c+d x))}{16 d}+\frac{b \left (14 a^2 C+18 a b B+5 b^2 C\right ) \tan (c+d x) \sec ^3(c+d x)}{24 d}+\frac{\left (18 a^2 b C+8 a^3 B+18 a b^2 B+5 b^3 C\right ) \tan (c+d x) \sec (c+d x)}{16 d}+\frac{b^2 (4 a C+3 b B) \tan (c+d x) \sec ^4(c+d x)}{15 d}+\frac{b C \tan (c+d x) \sec ^3(c+d x) (a+b \sec (c+d x))^2}{6 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4072
Rule 4026
Rule 4076
Rule 4047
Rule 3767
Rule 4046
Rule 3768
Rule 3770
Rubi steps
\begin{align*} \int \sec ^2(c+d x) (a+b \sec (c+d x))^3 \left (B \sec (c+d x)+C \sec ^2(c+d x)\right ) \, dx &=\int \sec ^3(c+d x) (a+b \sec (c+d x))^3 (B+C \sec (c+d x)) \, dx\\ &=\frac{b C \sec ^3(c+d x) (a+b \sec (c+d x))^2 \tan (c+d x)}{6 d}+\frac{1}{6} \int \sec ^3(c+d x) (a+b \sec (c+d x)) \left (3 a (2 a B+b C)+\left (5 b^2 C+6 a (2 b B+a C)\right ) \sec (c+d x)+2 b (3 b B+4 a C) \sec ^2(c+d x)\right ) \, dx\\ &=\frac{b^2 (3 b B+4 a C) \sec ^4(c+d x) \tan (c+d x)}{15 d}+\frac{b C \sec ^3(c+d x) (a+b \sec (c+d x))^2 \tan (c+d x)}{6 d}+\frac{1}{30} \int \sec ^3(c+d x) \left (15 a^2 (2 a B+b C)+6 \left (15 a^2 b B+4 b^3 B+5 a^3 C+12 a b^2 C\right ) \sec (c+d x)+5 b \left (18 a b B+14 a^2 C+5 b^2 C\right ) \sec ^2(c+d x)\right ) \, dx\\ &=\frac{b^2 (3 b B+4 a C) \sec ^4(c+d x) \tan (c+d x)}{15 d}+\frac{b C \sec ^3(c+d x) (a+b \sec (c+d x))^2 \tan (c+d x)}{6 d}+\frac{1}{30} \int \sec ^3(c+d x) \left (15 a^2 (2 a B+b C)+5 b \left (18 a b B+14 a^2 C+5 b^2 C\right ) \sec ^2(c+d x)\right ) \, dx+\frac{1}{5} \left (15 a^2 b B+4 b^3 B+5 a^3 C+12 a b^2 C\right ) \int \sec ^4(c+d x) \, dx\\ &=\frac{b \left (18 a b B+14 a^2 C+5 b^2 C\right ) \sec ^3(c+d x) \tan (c+d x)}{24 d}+\frac{b^2 (3 b B+4 a C) \sec ^4(c+d x) \tan (c+d x)}{15 d}+\frac{b C \sec ^3(c+d x) (a+b \sec (c+d x))^2 \tan (c+d x)}{6 d}+\frac{1}{8} \left (8 a^3 B+18 a b^2 B+18 a^2 b C+5 b^3 C\right ) \int \sec ^3(c+d x) \, dx-\frac{\left (15 a^2 b B+4 b^3 B+5 a^3 C+12 a b^2 C\right ) \operatorname{Subst}\left (\int \left (1+x^2\right ) \, dx,x,-\tan (c+d x)\right )}{5 d}\\ &=\frac{\left (15 a^2 b B+4 b^3 B+5 a^3 C+12 a b^2 C\right ) \tan (c+d x)}{5 d}+\frac{\left (8 a^3 B+18 a b^2 B+18 a^2 b C+5 b^3 C\right ) \sec (c+d x) \tan (c+d x)}{16 d}+\frac{b \left (18 a b B+14 a^2 C+5 b^2 C\right ) \sec ^3(c+d x) \tan (c+d x)}{24 d}+\frac{b^2 (3 b B+4 a C) \sec ^4(c+d x) \tan (c+d x)}{15 d}+\frac{b C \sec ^3(c+d x) (a+b \sec (c+d x))^2 \tan (c+d x)}{6 d}+\frac{\left (15 a^2 b B+4 b^3 B+5 a^3 C+12 a b^2 C\right ) \tan ^3(c+d x)}{15 d}+\frac{1}{16} \left (8 a^3 B+18 a b^2 B+18 a^2 b C+5 b^3 C\right ) \int \sec (c+d x) \, dx\\ &=\frac{\left (8 a^3 B+18 a b^2 B+18 a^2 b C+5 b^3 C\right ) \tanh ^{-1}(\sin (c+d x))}{16 d}+\frac{\left (15 a^2 b B+4 b^3 B+5 a^3 C+12 a b^2 C\right ) \tan (c+d x)}{5 d}+\frac{\left (8 a^3 B+18 a b^2 B+18 a^2 b C+5 b^3 C\right ) \sec (c+d x) \tan (c+d x)}{16 d}+\frac{b \left (18 a b B+14 a^2 C+5 b^2 C\right ) \sec ^3(c+d x) \tan (c+d x)}{24 d}+\frac{b^2 (3 b B+4 a C) \sec ^4(c+d x) \tan (c+d x)}{15 d}+\frac{b C \sec ^3(c+d x) (a+b \sec (c+d x))^2 \tan (c+d x)}{6 d}+\frac{\left (15 a^2 b B+4 b^3 B+5 a^3 C+12 a b^2 C\right ) \tan ^3(c+d x)}{15 d}\\ \end{align*}
Mathematica [A] time = 2.61277, size = 214, normalized size = 0.77 \[ \frac{15 \left (18 a^2 b C+8 a^3 B+18 a b^2 B+5 b^3 C\right ) \tanh ^{-1}(\sin (c+d x))+\tan (c+d x) \left (80 \left (3 a^2 b B+a^3 C+6 a b^2 C+2 b^3 B\right ) \tan ^2(c+d x)+10 b \left (18 a^2 C+18 a b B+5 b^2 C\right ) \sec ^3(c+d x)+15 \left (18 a^2 b C+8 a^3 B+18 a b^2 B+5 b^3 C\right ) \sec (c+d x)+240 \left (3 a^2 b B+a^3 C+3 a b^2 C+b^3 B\right )+48 b^2 (3 a C+b B) \tan ^4(c+d x)+40 b^3 C \sec ^5(c+d x)\right )}{240 d} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.052, size = 478, normalized size = 1.7 \begin{align*}{\frac{B{a}^{3}\sec \left ( dx+c \right ) \tan \left ( dx+c \right ) }{2\,d}}+{\frac{B{a}^{3}\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{2\,d}}+{\frac{2\,{a}^{3}C\tan \left ( dx+c \right ) }{3\,d}}+{\frac{{a}^{3}C\tan \left ( dx+c \right ) \left ( \sec \left ( dx+c \right ) \right ) ^{2}}{3\,d}}+2\,{\frac{B{a}^{2}b\tan \left ( dx+c \right ) }{d}}+{\frac{B{a}^{2}b\tan \left ( dx+c \right ) \left ( \sec \left ( dx+c \right ) \right ) ^{2}}{d}}+{\frac{3\,{a}^{2}bC\tan \left ( dx+c \right ) \left ( \sec \left ( dx+c \right ) \right ) ^{3}}{4\,d}}+{\frac{9\,{a}^{2}bC\sec \left ( dx+c \right ) \tan \left ( dx+c \right ) }{8\,d}}+{\frac{9\,{a}^{2}bC\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{8\,d}}+{\frac{3\,Ba{b}^{2}\tan \left ( dx+c \right ) \left ( \sec \left ( dx+c \right ) \right ) ^{3}}{4\,d}}+{\frac{9\,Ba{b}^{2}\sec \left ( dx+c \right ) \tan \left ( dx+c \right ) }{8\,d}}+{\frac{9\,Ba{b}^{2}\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{8\,d}}+{\frac{8\,Ca{b}^{2}\tan \left ( dx+c \right ) }{5\,d}}+{\frac{3\,Ca{b}^{2}\tan \left ( dx+c \right ) \left ( \sec \left ( dx+c \right ) \right ) ^{4}}{5\,d}}+{\frac{4\,Ca{b}^{2}\tan \left ( dx+c \right ) \left ( \sec \left ( dx+c \right ) \right ) ^{2}}{5\,d}}+{\frac{8\,B{b}^{3}\tan \left ( dx+c \right ) }{15\,d}}+{\frac{B{b}^{3}\tan \left ( dx+c \right ) \left ( \sec \left ( dx+c \right ) \right ) ^{4}}{5\,d}}+{\frac{4\,B{b}^{3}\tan \left ( dx+c \right ) \left ( \sec \left ( dx+c \right ) \right ) ^{2}}{15\,d}}+{\frac{C{b}^{3}\tan \left ( dx+c \right ) \left ( \sec \left ( dx+c \right ) \right ) ^{5}}{6\,d}}+{\frac{5\,C{b}^{3}\tan \left ( dx+c \right ) \left ( \sec \left ( dx+c \right ) \right ) ^{3}}{24\,d}}+{\frac{5\,C{b}^{3}\sec \left ( dx+c \right ) \tan \left ( dx+c \right ) }{16\,d}}+{\frac{5\,C{b}^{3}\ln \left ( \sec \left ( dx+c \right ) +\tan \left ( dx+c \right ) \right ) }{16\,d}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 0.99116, size = 552, normalized size = 1.99 \begin{align*} \frac{160 \,{\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} C a^{3} + 480 \,{\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} B a^{2} b + 96 \,{\left (3 \, \tan \left (d x + c\right )^{5} + 10 \, \tan \left (d x + c\right )^{3} + 15 \, \tan \left (d x + c\right )\right )} C a b^{2} + 32 \,{\left (3 \, \tan \left (d x + c\right )^{5} + 10 \, \tan \left (d x + c\right )^{3} + 15 \, \tan \left (d x + c\right )\right )} B b^{3} - 5 \, C b^{3}{\left (\frac{2 \,{\left (15 \, \sin \left (d x + c\right )^{5} - 40 \, \sin \left (d x + c\right )^{3} + 33 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{6} - 3 \, \sin \left (d x + c\right )^{4} + 3 \, \sin \left (d x + c\right )^{2} - 1} - 15 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 15 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 90 \, C a^{2} b{\left (\frac{2 \,{\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 90 \, B a b^{2}{\left (\frac{2 \,{\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 120 \, B a^{3}{\left (\frac{2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )}}{480 \, d} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.579748, size = 706, normalized size = 2.54 \begin{align*} \frac{15 \,{\left (8 \, B a^{3} + 18 \, C a^{2} b + 18 \, B a b^{2} + 5 \, C b^{3}\right )} \cos \left (d x + c\right )^{6} \log \left (\sin \left (d x + c\right ) + 1\right ) - 15 \,{\left (8 \, B a^{3} + 18 \, C a^{2} b + 18 \, B a b^{2} + 5 \, C b^{3}\right )} \cos \left (d x + c\right )^{6} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \,{\left (32 \,{\left (5 \, C a^{3} + 15 \, B a^{2} b + 12 \, C a b^{2} + 4 \, B b^{3}\right )} \cos \left (d x + c\right )^{5} + 15 \,{\left (8 \, B a^{3} + 18 \, C a^{2} b + 18 \, B a b^{2} + 5 \, C b^{3}\right )} \cos \left (d x + c\right )^{4} + 40 \, C b^{3} + 16 \,{\left (5 \, C a^{3} + 15 \, B a^{2} b + 12 \, C a b^{2} + 4 \, B b^{3}\right )} \cos \left (d x + c\right )^{3} + 10 \,{\left (18 \, C a^{2} b + 18 \, B a b^{2} + 5 \, C b^{3}\right )} \cos \left (d x + c\right )^{2} + 48 \,{\left (3 \, C a b^{2} + B b^{3}\right )} \cos \left (d x + c\right )\right )} \sin \left (d x + c\right )}{480 \, d \cos \left (d x + c\right )^{6}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int \left (B + C \sec{\left (c + d x \right )}\right ) \left (a + b \sec{\left (c + d x \right )}\right )^{3} \sec ^{3}{\left (c + d x \right )}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] time = 1.29572, size = 1258, normalized size = 4.53 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]